#ifndef GLRENDERER_H
#define GLRENDERER_H

#include <QtOpenGL/QGLWidget>
#include "model.h"

class GLRenderer : public QGLWidget
{
     Q_OBJECT
public:
    GLRenderer(QWidget *parent = 0);
    void initializeGL();
    void resizeGL(int w, int h);
    void paintGL();
    void timerEvent(QTimerEvent *);
    void mouseMoveEvent(QMouseEvent *);
    void mousePressEvent(QMouseEvent *);
public slots:
    void setModel(model * m);
    void rotX(int rot);
    void rotY(int rot);
    void zoom(int scale);
    void setLightPos(float x, float y, float z);
private:
    model * m_Model;
    GLfloat m_lightAmbient[4];
    GLfloat m_lightSpecular[4];
    GLfloat m_lightPosition[4];
    float m_rX, m_rY, m_Scale;
    float m_preMouseX, m_preMouseY;
};

#endif // GLRENDERER_H
